1. Field of Invention
The present invention relates to the field of network communications. In particular, the present invention describes a method and apparatus for network variable aliasing.
2. Description of Related Art
In most computer networks, information is communicated using messages. Nodes on the network prepare messages and transmit the messages to other nodes on the network. Each message contains a number of bytes identifying the message (a "header") and a number of bytes corresponding to the information to be communicated. These types of networks can be used in control systems. For example, a control system network can be used to control the heating, lighting and the ventilation of a large building.
Nodes contain the mechanisms through which application programs can share information with other application programs. Application programs store information in variables. For example, a switch control application may store in a variable SW1 a value indicating whether a particular switch is on. The value of the variable SW1 may be required by a light control application program which controls power to a light. The light control application program may store this value in a variable with a different name than that used by the switch control application. For example, the light control application may store the value in a variable LGT5. The process of communicating the value stored in the variable SW 1 of the switch control application to the variable LGT5 in the light control application involves (1) communicating the value stored in SW 1 to a node (NODE 1) associated with the switch control program, (2) packaging the value in a message, (3) sending the message to a node (NODE2) associated with the light control program, (4) retrieving the value from the message, and (5) storing the value in the variable LGT5 of the light control program.
If the value of a variable in one application is sent over the network to another application, the variable is referred to as an output network variable. If the value of a variable in one application is updated based on information sent over the network from another application, then the variable is referred to as an input network variable.
As mentioned above, the variables used to store the same value in different applications may have different names. To make sure that information is routed to and from the correct network variables, a common connection name or "selector" is assigned to each of the related network variables. For example, the connection used to transfer the value of SW1 between the NODE1 and NODE2 may be assigned the selector "CN1".
Each network variable corresponds to a network connection point on a node. Each node stores information indicating the correspondence between each of its network connection points and the connection to which its network connection points correspond. For example, NODE 1 would keep track of the fact that connection CN1 corresponds to a network connection point associated with SW1, and NODE2 would keep track of the fact that connection CN1 corresponds to a network connection point associated with LGT5. Thus, when NODE1 is instructed to send the value of SW1, it sends the value to NODE2 in a message which identifies the connection CN1. When NODE2 receives the message, it determines that the message is associated with connection CN1, and therefore knows to store the value contained in the message in variable LGT5.
A node may keep track of the correspondence between its network connection points and their respective connections by maintaining a table in which each entry includes data indicating a network variable and the selector for the network variable.
Certain constraints exist on the network variable-to-connection mapping. For example, there may be only one connection associated with each network connection point of a given node. For example, the network connection point associated with SW1 may not be associated with any connection other than connection CN1. Similarly, within NODE2, the network connection point associated with LGT5 may not be associated with any connection other than connection CN1. More specifically, an input network variable can only be associated with one connection and no other input network variable of that node can be associated with that same connection. Similarly, an output network variable can only be associated with one connection and no other output network variable of that node can be associated with that same connection.
As a result of these constraints, when a connection is made between an input variable and an output variable and one of the variables is already in a connection, then the new connection must use the same selector as the previous connection. For example, if a valve control application associated with a NODE3 has a variable VC1 into which the value of SW1 must be stored, then the network connection point associated with the variable VC1 must be associated with the selector CN1. If the network connection point associated with VC1 was associated with a different selector, then NODE3 would not know to store the value contained in the messages identifying connection CN1 into VC1.
Because only one selector can be associated with each network connection point of a node and because the selector is used to determine which input variables to update when a network variable message is received, some network configurations are illegal. For example, consider the situation shown in FIG. 1 in which a node 100 has two output network variables SW1 and SW2. The value of SW1 indicates whether a switch 104 is on, and the value of SW2 indicates whether a switch 106 is on. A node 102 has two input network variables LGT1 and LGT2. The value of LGT1 determines whether a light 108 is on, and the value of LGT2 determines whether a light 110 is on. A user may want the switch 104 to control the light 108, and the switch 106 to control both light 108 and light 110.
To establish a connection between the variables SW1 and LGT1, a selector is established for the messages which convey the value of SW 1 to node 100. The process of establishing a connection between variables is referred to herein as "binding" the variables. For example, SW1 may be bound to LGT1 by establishing a selector CN1 between the output 112 of node 102 associated with the variable SW1 and the input 116 of node 100 associated with variable LGT1. This binding is illustrated by line 120. Node 100 would store a selector indicating that SW 1 is associated with CN1, and node 102 would store a selector indicating that LGT1 was associated with CN1.
To allow the switch 106 to control both the light 108 and light 110, SW2 must be bound to both LGT1 and LGT2. Since LGT1 already belongs to a connection, the name of the pre-existing connection (CN1) must be used to bind the output 114 associated with SW2 to the input 116 associated with LGT1. The resulting binding is illustrated by line 122. Thus, messages sent over connection CN1 responsive to switch 106 will be used to update LGT1. I0 For the switch 106 to also control the light 110, SW2 must also be bound to LGT2. Since SW2 now belongs to the connection CN1, the binding of SW2 to LGT2 is performed by establishing the input 118 associated with LGT2 as part of connection CN1. This binding is illustrated by line 124. After these bindings are performed, both LGT1 and LGT2 will be associated with the same connection CN1. Therefore, both LGT1 and LGT2 will be updated by messages identifying CN1.
Unfortunately, the configuration shown in FIG. 1 does not yield the desired functionality. Specifically, node 100 would not be able to distinguish between messages containing the value SW1 and messages containing the value SW2, since both would be identified by the selector CN1. Thus, a message indicating that switch 104 was turned on would affect both lights 108 and 110. In addition, if node 102 is polled over connection CN1, it would not know whether to respond by sending the value contained in SW1, the value contained in SW2, or two messages, one for SW1 and one for SW2. If node 102 sent two messages in response to a single polling operation, node 100 would not know how to interpret the two responses. Typically, the second response would be discarded as a duplicate of the first response.
Another problematic configuration is illustrated in FIG. 2. In FIG. 2, a connection labeled "1" connects an output network connection point 208 of a node 200 with an input network connection point 210 of a node 202 and an output network connection point 212 of a node 204. A connection labeled "2" connects an output network connection point 216 of node 200 with an input network connection point 214 of a node 206. This configuration may occur, for example, if input network connection point 210 is associated with a light and output network connection points 212 and 208 are associated with switches to control the light, while input network connection point 214 is associated with a second light and output network connection point 216 is associated with a switch to control the second light.
A problem occurs when an attempt is made to bind output network connection point 212 with input network connection point 214. This binding may be desirable, for example, to control the lights associated with inputs 210 and 214 with the single switch associated with output network connection point 212. Input network connection point 214 is already associated with connection "1", while output network connection point 212 is already associated with connection "2". Since neither input network connection point 21.4 nor output network connection point 212 can be associated with both connections "1" and "2", input network connection point 214 cannot be bound with output network connection point 212. This type of problem is referred to hereafter as a connection conflict.
Based on the foregoing, it is desirable to provide a control system with greater flexibility than is currently provided. It is also desirable to provide a node with fewer configuration constraints than the nodes currently used in control networks. Further, it is desirable to provide an apparatus and method for handling connection conflicts.